<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author: Author: LJQ <liujiqi@etrol.com>
// +----------------------------------------------------------------------

namespace app\warning\controller;

use app\common\controller\Admin;
use app\warning\controller\api\Evaluation as EvaluationApi;


/**
 * 企业风险评估
 * @package app\Warning
 */
class Evaluation  extends Admin{

    public function _initialize()
    {
        parent::_initialize();
        $this->api = new EvaluationApi();
    }



    public function index(){
        //单位列表
        $enterpriseList = model('basic/Enterprise')->getSelectList($this->scope);
        $this->assign('enterpriseList',$enterpriseList);
        if(IS_AJAX){
            $enterpriseId=input('enterpriseId',1,'intval');

            $evaluationList = $this->api->getEvaluationList($enterpriseId);
            return $evaluationList;
       }

        return $this->fetch();
    }

    public function edit($enterpriseId = null){
    	if(IS_POST){
    		 return $this->api->edit(input('post.'),$enterpriseId);
    	}
    }
    
    
    public function autoScoring($enterpriseId = null){
    	if (IS_AJAX){
    		return $this->api->autoScoring($enterpriseId);
    	}
    }


}